package com.ruoyi.web.controller;

import com.aliyuncs.live.model.v20161101.DescribeLiveStreamStateRequest;
import com.aliyuncs.live.model.v20161101.DescribeLiveStreamStateResponse;
import com.aliyuncs.live.model.v20161101.DescribeLiveStreamsOnlineListRequest;
import com.aliyuncs.live.model.v20161101.DescribeLiveStreamsOnlineListResponse;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.web.service.impl.AliyunLiveService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * description:
 * auth fcb
 * date 2025-07-16 12:02
 **/
@RestController
@Api(tags = "访问码控制层")
@RequestMapping("/live")
public class AliyunLiveController {

    @Autowired
    private AliyunLiveService aliyunLiveService;

    @GetMapping("/test-1")
    public AjaxResult test() {
        DescribeLiveStreamsOnlineListRequest request = new DescribeLiveStreamsOnlineListRequest();
        request.setDomainName("dx1test-play.shinmade.com");
        DescribeLiveStreamsOnlineListResponse describeLiveStreamsOnlineListResponse = aliyunLiveService.describeLiveStreamsOnlineList(request);
        return AjaxResult.success(describeLiveStreamsOnlineListResponse);
    }

//    @GetMapping("/test")
//    public AjaxResult test2() {
//        String authUrl = aliyunLiveService.getAuthUrl("AppName", "StreamName", "m3u8", 20L);
//        return AjaxResult.success(authUrl);
//    }

}
